CPU 686
BITS 32

%define PIC1_CMD  0x20
%define EOI 0x20 
%define DATA_REG 0x60

global _kbd_handler
extern _kbd_queue
extern _queuePut

section .data
_scancode dd 0

section .text
_kbd_handler:
	push eax
	xor eax, eax
	in al, DATA_REG
	sti
	push eax
	push dword[_kbd_queue]
	call _queuePut
	add esp, 8
	
	mov al, EOI
	out PIC1_CMD, al
	pop eax
	iretd
END
